//
//  Level.h
//  CandyCrushClone
//
//  Created by  Stefan Nestorov on 12/29/14.
//  Copyright (c) 2014 Nestorov Engineering. All rights reserved.
//

#import "RWTCookie.h"
#import "RWTTile.h"
#import "RWTSwap.h"
#import "RWTChain.h"
#import "LevelAdapter.h"

static const NSInteger NumColumns = 9;
static const NSInteger NumRows = 9;

@interface RWTLevel : NSObject <LevelAdapterDelegate>

@property (assign, nonatomic) NSUInteger targetScore;
@property (assign, nonatomic) NSUInteger maximumMoves;
@property (assign, nonatomic, readonly) BOOL isSimulation;


- (instancetype)initWithFile:(NSString *)filename;
- (NSSet *)shuffle;
- (RWTTile *)tileAtColumn:(NSInteger)column row:(NSInteger)row;
- (RWTCookie *)cookieAtColumn:(NSInteger)column row:(NSInteger)row;
- (void)performSwap:(RWTSwap *)swap isSimulation:(BOOL)isSimulation;
- (void)detectPossibleSwaps;
- (BOOL)isPossibleSwap:(RWTSwap *)swap;
- (NSSet *)removeMatches;
- (NSArray *)fillHoles;
- (NSArray *)topUpCookies;
- (RWTSwap *)getHintPossibleSwap;
- (NSSet *)getCurrentBoardFromServerIfNecessary;

- (void)printCookies;
- (void)printTiles;

@end